<?php

/**
 * default actions.
 *
 * @package    vmdai
 * @subpackage default
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class defaultActions extends sfActions
{
    
  public function executeError404(sfWebRequest $request){
      $this->getResponse()->setTitle("微美贷VMdai官网_中国领先的互联网金融P2P网贷平台_网络贷款_投资理财");
  }  
    
    
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request){
     $this->getResponse()->setTitle("微美贷VMdai官网_中国领先的互联网金融P2P网贷平台_网络贷款_投资理财");
    
     $this->list = Doctrine::getTable('Loan')->createQuery()->limit(3)->orderBy('created_at desc')->execute();
  }
  
  public function executeAboutus(sfWebRequest $request){
     $this->getResponse()->setTitle("关于我们--微美贷VMdai官网_中国领先的互联网金融P2P网贷平台_网络贷款_投资理财");
     
  }
    public function executeLaw(sfWebRequest $request){
      $this->getResponse()->setTitle("网站声明--微美贷VMdai官网_中国领先的互联网金融P2P网贷平台_网络贷款_投资理财");
     
  }
  
   public function executeTariff(sfWebRequest $request){
      $this->getResponse()->setTitle("资费说明--微美贷VMdai官网_中国领先的互联网金融P2P网贷平台_网络贷款_投资理财");
  }
  
  public function executeContactus(sfWebRequest $request){
     $this->getResponse()->setTitle("联系我们--微美贷VMdai官网_中国领先的互联网金融P2P网贷平台_网络贷款_投资理财");
  }
  
    public function executeSecurity(sfWebRequest $request){
     $this->getResponse()->setTitle("安全保障--微美贷VMdai官网_中国领先的互联网金融P2P网贷平台_网络贷款_投资理财");
  }
  
   public function executeIndustry(sfWebRequest $request){
       $this->getResponse()->setTitle("行业资讯--微美贷VMdai官网_中国领先的互联网金融P2P网贷平台_网络贷款_投资理财");
  }
  
   public function executeMedia(sfWebRequest $request){
     $this->getResponse()->setTitle("媒体报道--微美贷VMdai官网_中国领先的互联网金融P2P网贷平台_网络贷款_投资理财");
  }
  
   public function executeNotice(sfWebRequest $request){
     //获取公告列表
     $notice= new Notices();
     $this->notices = Doctrine::getTable('Notices')->createQuery()
                                                 ->where('status = ?',1)
                                                  ->orderBy('created_at desc')
                                                 ->execute();
     $this->getResponse()->setTitle("公告--微美贷VMdai官网_中国领先的互联网金融P2P网贷平台_网络贷款_投资理财");
  }
  
    public function executeNoticedetail(sfWebRequest $request){
     $id = $request->getParameter("id",0);
     $this->notice=Doctrine::getTable('Notices')->findOneById($id);
     $this->getResponse()->setTitle("公告详情--微美贷VMdai官网_中国领先的互联网金融P2P网贷平台_网络贷款_投资理财");
             
  }
  
  public function executeNovice(sfWebRequest $request){
     $this->getResponse()->setTitle("新手指引--微美贷VMdai官网_中国领先的互联网金融P2P网贷平台_网络贷款_投资理财");
  }
    public function executeBidflow(sfWebRequest $request){
      $this->getResponse()->setTitle("投资指引--微美贷VMdai官网_中国领先的互联网金融P2P网贷平台_网络贷款_投资理财");
  }
     public function executeHelp1(sfWebRequest $request){
     $this->getResponse()->setTitle("常见问题--微美贷VMdai官网_中国领先的互联网金融P2P网贷平台_网络贷款_投资理财");
  }
  
      public function executeHelp2(sfWebRequest $request){
     $this->getResponse()->setTitle("常见问题--微美贷VMdai官网_中国领先的互联网金融P2P网贷平台_网络贷款_投资理财");
  }
      public function executeHelp3(sfWebRequest $request){
     $this->getResponse()->setTitle("常见问题--微美贷VMdai官网_中国领先的互联网金融P2P网贷平台_网络贷款_投资理财");
  }
  
      public function executeHelp4(sfWebRequest $request){
     $this->getResponse()->setTitle("常见问题--微美贷VMdai官网_中国领先的互联网金融P2P网贷平台_网络贷款_投资理财");
  }
  
      public function executeHelp5(sfWebRequest $request){
     $this->getResponse()->setTitle("常见问题--微美贷VMdai官网_中国领先的互联网金融P2P网贷平台_网络贷款_投资理财");
  }
  
      public function executeHelp6(sfWebRequest $request){
     $this->getResponse()->setTitle("常见问题--微美贷VMdai官网_中国领先的互联网金融P2P网贷平台_网络贷款_投资理财");
  }
  
   public function executeFeedback(sfWebRequest $request){
      $message = "";
      $result = "";
      $user_id = $this->getUser()->getAttribute("user_id",-1);
      if(!$user_id){
        $user_id="-1";
      }
      if($request->isMethod("POST")){
          $contents = $request->getParameter("contents");
          $feed_back = new UserFeedBack();
          $feed_back->setUserId($user_id)->setContents($contents)->save();
          $message = 'success';
          $result = "ok";
          echo json_encode(array("result"=>$result,'message'=>$message));
          exit;
        }
       
      
  }
  
  
     public function executeProtocol(sfWebRequest $request){
     $this->getResponse()->setTitle("微美贷网站服务协议");
  }
  
  
  
  
}
